/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package app.controller;

import app.business.NewsSessionBean;
import app.entity.News;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author DangThanh
 */
@ManagedBean(name = "newsManagedBean")
@SessionScoped
public class NewsManagedBean {

    @EJB
    private NewsSessionBean newsSessionBean;
    private News news;

    public News getNews() {
        return news;
    }

    public void setNews(News news) {
        this.news = news;
    }

    /**
     * Creates a new instance of NewsManagedBean
     */
    public NewsManagedBean() {
        news = new News();
    }

    public List<News> getNew() {
        return newsSessionBean.getAllNews();
    }
}
